<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/shuijisuan.css">
</head>
<body>
    <!-- <script src="js/shujisuan.js"></script> -->
    <div class="content">
        <span class="gz">工资</span>
        
        <input type="text" id="value" placeholder="要获取的输入的值"/>
 
        <input type="button" value="计算" onclick="huoqu()"/>
    <div>
        <ul>
            <li>养老保险：<span id="a"></span></li>
            <li>医疗保险：<span id="b"></span></li>
            <li>失业保险：<span id="c"></span></li>
            <li>生育保险：<span id="d"></span></li>
            <li>工伤保险：<span id="e"></span></li>
            <li>住房公积金：<span id="f"></span></li>
            <li>需缴税：<span id="money"></span></li>
            <li>实得工资：<span id="h"></span></li>
        </ul>
    </div>
    </div>
    <script>
           
        function huoqu(){
         var sum =0;
         var z=document.getElementById('value').value;
         var J=document.getElementById('money');
         var a=document.getElementById('a');
         var b=document.getElementById('b');
         var c=document.getElementById('c');
         var d=document.getElementById('d');
         var e=document.getElementById('e');
         var f=document.getElementById('f');
         var h=document.getElementById('h');
          
        var aa=7662*0.08;
        var bb=7662*0.02;
        var cc=7662*0.005;
        var dd=7662*0;
        var ee=7662*0;
        var ff=7662*0.1;
        var G=0;
        if(z>=7662){
           G=z-1570.71-5000;
          } else if(z>6025){
            G=z-1025-5000;
           
        }else{
            G=0;
            aa=5000*0.08;
            bb=5000*0.02;
            cc=5000*0.005;
            dd=5000*0;
            ee=5000*0;
            ff=5000*0.1;
        }
         

         console.log(G);
          if(G <= 1025){
              sum = (G*0.03);
              J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff; 
              hh=z-1025-sum;
              h.innerHTML= hh;
          }else if(G <= 3000){
              sum = (G*0.03);
              J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff; 
              hh=z-1570.71-sum;
              h.innerHTML= hh;
          }
          else if(G<=12000){
            sum = (G*0.1-210);
            J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff;
              hh=z-1570.71-sum;
              h.innerHTML= hh;
          }else if(G<=25000){
            sum = (G*0.2-1410);
            J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff; 
              hh=z-1570.71-sum;
              h.innerHTML= hh;
          }else if(G<=35000){
            sum = (G*0.25-2660);
            J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff; 
              hh=z-1570.71-sum;
              h.innerHTML= hh;
          }else if(G<=55000){
            sum = (G*0.3-4410);
            J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff; 
              hh=z-1570.71-sum;
              h.innerHTML= hh;
          }else if(G<=80000){
            sum = (G*0.35-7160);
            J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff; 
              hh=z-1570.71-sum;
              h.innerHTML= hh;
          }else{
            sum = (G*0.45-15160);
            J.innerHTML=sum;
              a.innerHTML= aa; 
              b.innerHTML= bb; 
              c.innerHTML= cc; 
              d.innerHTML= dd; 
              e.innerHTML= ee; 
              f.innerHTML= ff; 
              hh=z-1570.71-sum;
              h.innerHTML= hh;
          }
         
        

        }
    </script>
</body>
</html>